# -*-coding: utf-8 -*-
"""
    @Theme   : Flask App Configs
    @Time    : 2024/7/7 16:50
    @Author  : YamFish
    @Url     : https://www.zhihu.com/people/yamfish
"""
import os


MONGODB_URI = os.getenv('MONGODB_DATABASE_URI')
MONGODB_DATABASE = 'qanda_db'

REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
REDIS_PORT = os.getenv('REDIS_PORT', 6379)
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD')

SESSION_EXPIRE_DAYS = 30

BLOOM_CAPACITY = 1_000_000
BLOOM_ERROR_RATE = 0.001

QUESTION_PER_PAGE = 10
QUESTION_ANSWER_PER_PAGE = 10

MONGO_QUESTION_COLLECTION = 'question'
MONGO_ANSWER_COLLECTION = 'answer'
MONGO_USER_COLLECTION = 'user'
MONGO_VOTE_COLLECTION = 'vote'

REDIS_KEY_SESSION = 'qa_system:session'
REDIS_KEY_SESSION_EXPIRE = 'qa_system:session:expire'
REDIS_KEY_USER_ANSWER = 'qa_system:user:answer'
REDIS_KEY_USER_VOTE = 'qa_system:user:vote'
REDIS_KEY_USER_BLOOM = 'qa_system:bloom'
REDIS_KEY_QUESTION_VOTE = 'qa_system:question:vote'
REDIS_KEY_ANSWER_VOTE = 'qa_system:answer:{}:vote'
